package com.abc.controller.web;

import com.abc.dao.ExampleMapper;
import com.abc.dao.PlanMapper;
import com.abc.dao.SwiperMapper;
import com.abc.dao.base.PlanBaseMapper;
import com.abc.dao.base.SwiperBaseMapper;
import com.abc.entity.Example;
import com.abc.entity.Plan;
import com.abc.vo.ExampleVo;
import com.abc.vo.SwiperVo;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping(value = {"", "index"})
public class IndexController {

    @Autowired
    SwiperBaseMapper swiperBaseMapper;

    @Autowired
    SwiperMapper swiperMapper;

    @Autowired
    PlanBaseMapper planBaseMapper;


    @Autowired
    ExampleMapper exampleMapper;

    @GetMapping("")
    public String hello(ModelMap map) {
        List<SwiperVo> swiperList = swiperMapper.selectSwiperListWithImgPath();
        map.addAttribute("list", swiperList);
        List<ExampleVo> exampleList = exampleMapper.getTopExampleList();
        map.addAttribute("eList", exampleList);
        return "index";
    }



}
